package com.lonty.intelligence.service;

import com.lonty.intelligence.mapper.AreaMapper;
import com.lonty.intelligence.model.Area;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * @Author 陈璇
 * @Date 2020/4/17 11:51
 * @Version 1.0
 */
@Service
public class AreaService {

    @Resource
    private AreaMapper areaMapper;

    /**
     * 保存小区
     * @param area
     * @return
     */
    public boolean saveArea(Area area){
        return areaMapper.saveArea(area) > 0;
    }

    /**
     * 根据社区ID获取小区
     * @param communityId
     * @return
     */
    public List<Area> listArea(String communityId){
        return areaMapper.listArea(communityId);
    }

}
